package com.zhuliyou.ai.config;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * 我的异常处理程序
 *
 * @author zhuliyou
 * @date 2021/06/02
 */
@ControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(value = Exception.class)
    public String exceptionHandler(Exception e) {
        System.out.println("未知异常！原因是:" + e);
        e.printStackTrace();
        return e.getMessage();
    }
}
